import 'package:safetymonitor/generated/json/base/json_convert_content.dart';
import 'package:safetymonitor/app/data/entities/home/analysis/get_record_person_sort_entity.dart';

GetRecordPersonSortEntity $GetRecordPersonSortEntityFromJson(Map<String, dynamic> json) {
  final GetRecordPersonSortEntity getRecordPersonSortEntity = GetRecordPersonSortEntity();
  final String? name = jsonConvert.convert<String>(json['name']);
  if (name != null) {
    getRecordPersonSortEntity.name = name;
  }
  final int? count = jsonConvert.convert<int>(json['count']);
  if (count != null) {
    getRecordPersonSortEntity.count = count;
  }
  final int? percent2 = jsonConvert.convert<int>(json['percent2']);
  if (percent2 != null) {
    getRecordPersonSortEntity.percent2 = percent2;
  }
  final double? signedInPercent = jsonConvert.convert<double>(json['signedInPercent']);
  if (signedInPercent != null) {
    getRecordPersonSortEntity.signedInPercent = signedInPercent;
  }
  final double? notSignedInPercent = jsonConvert.convert<double>(json['notSignedInPercent']);
  if (notSignedInPercent != null) {
    getRecordPersonSortEntity.notSignedInPercent = notSignedInPercent;
  }
  return getRecordPersonSortEntity;
}

Map<String, dynamic> $GetRecordPersonSortEntityToJson(GetRecordPersonSortEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['name'] = entity.name;
  data['count'] = entity.count;
  data['percent2'] = entity.percent2;
  data['signedInPercent'] = entity.signedInPercent;
  data['notSignedInPercent'] = entity.notSignedInPercent;
  return data;
}

extension GetRecordPersonSortEntityExtension on GetRecordPersonSortEntity {
  GetRecordPersonSortEntity copyWith({
    String? name,
    int? count,
    int? percent2,
    double? signedInPercent,
    double? notSignedInPercent,
  }) {
    return GetRecordPersonSortEntity()
      ..name = name ?? this.name
      ..count = count ?? this.count
      ..percent2 = percent2 ?? this.percent2
      ..signedInPercent = signedInPercent ?? this.signedInPercent
      ..notSignedInPercent = notSignedInPercent ?? this.notSignedInPercent;
  }
}